package com.jzo2o.customer.controller.worker;


import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditAddReqDTO;
import com.jzo2o.customer.model.dto.response.RejectReasonResDTO;
import com.jzo2o.customer.service.IWorkerCertificationAuditService;
import com.jzo2o.customer.service.IWorkerCertificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 服务端 - 认证审核
 */
@RestController("workerCertificationAuditController")
@RequestMapping("/worker/worker-certification-audit")
@Api(tags = "服务端 - 认证审核")
public class CertificationAuditController {
    @Resource
    private IWorkerCertificationService workerCertificationService; // 服务人员认证表Service
    @Resource
    private IWorkerCertificationAuditService workerCertificationAuditService; // 服务人员认证表Service


    /**
     * 服务人员 - 提交认证申请
     * @param workerCertificationAuditAddReqDTO 认证申请信息
     */
    @PostMapping("")
    @ApiOperation("服务端 - 提交认证申请")
    public void addCertificationInfo(@RequestBody WorkerCertificationAuditAddReqDTO workerCertificationAuditAddReqDTO) {
        workerCertificationService.addCertificationInfoForWorker(workerCertificationAuditAddReqDTO);
    }

    /**
     * 服务人员 - 查询最新驳回原因
     */
    @GetMapping("/rejectReason")
    @ApiOperation("查询最新驳回原因")
    public RejectReasonResDTO getLatestRejectReason() {
        return workerCertificationAuditService.getLatestRejectReason();
    }

}
